﻿<Window x:Class="StivTaskConsole.ServerChooser"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dw="clr-namespace:DrWPF.Windows.Controls"
        xmlns:local="clr-namespace:TreeViewWithCheckBoxes"
        Title="ServerChooser" Height="629.821" Width="1094.955" MinHeight="477" MinWidth="896">
    <Window.Resources>
        <ResourceDictionary>
            <Style x:Key="TreeViewItemStyle" TargetType="TreeViewItem">
                <Setter Property="IsExpanded" Value="False" />
                <Setter Property="IsSelected" Value="{Binding IsInitiallySelected, Mode=OneTime}" />
                <Setter Property="KeyboardNavigation.AcceptsReturn" Value="True" />
                <Setter Property="dw:VirtualToggleButton.IsVirtualToggleButton" Value="True" />
                <Setter Property="dw:VirtualToggleButton.IsChecked" Value="{Binding IsChecked}" />
            </Style>

            <HierarchicalDataTemplate  x:Key="CheckBoxItemTemplate" ItemsSource="{Binding Children, Mode=OneTime}"  >
                <StackPanel Orientation="Horizontal">
                    <!-- These elements are bound to a CheckTreeViewModel object. -->
                    <CheckBox  Focusable="False"  IsChecked="{Binding IsChecked}"   VerticalAlignment="Center"   />
                    <ContentPresenter Content="{Binding Name, Mode=OneTime}" Margin="2,0" />
                </StackPanel>
            </HierarchicalDataTemplate>
        </ResourceDictionary>
    </Window.Resources>

    <Window.DataContext>
        <ObjectDataProvider MethodName="CreateTreeList" ObjectType="{x:Type local:CheckTreeViewModel}"/>
    </Window.DataContext>

    <Grid Margin="10,10,2,5">
        <Button x:Name="UseSelectedButton" Content="Accept" Margin="0,0,10,10" Height="20" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="75" Click="UseSelectedButton_Click"/>
        <Button x:Name="CancelButton" Content="Cancel" HorizontalAlignment="Right" Margin="0,0,106,10" Width="75" RenderTransformOrigin="0.053,0.55" Height="20" VerticalAlignment="Bottom" IsCancel="True"/>
        <ComboBox x:Name="IRoles" HorizontalAlignment="Right" Margin="0,43,447,0" VerticalAlignment="Top" Width="120"/>
        <TextBox x:Name="ServerlistTextbox" Margin="0,10,10,48" TextWrapping="Wrap" Text="Serverlist goes in here!" TextChanged="ServerlistTextbox_TextChanged" HorizontalAlignment="Right" Width="385" ScrollViewer.CanContentScroll="True" VerticalScrollBarVisibility="Auto"/>
        <TextBox x:Name="IncludedRolesTextbox" Height="108" Margin="0,97,412,0" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Right" Width="212" Text="((Any Role))"/>
        <Label x:Name="IncludeLabel" Content="Include Roles" Margin="0,14,536,0" VerticalAlignment="Top" ClipToBounds="True" HorizontalAlignment="Right" Width="88"/>
        <Button x:Name="AddIncludeButton" Content="&gt;&gt;" HorizontalAlignment="Right" Margin="0,43,412,0" VerticalAlignment="Top" Width="23" Click="IncludeButton_Click" ToolTip="Add to Required List" RenderTransformOrigin="0.652,0.5"/>
        <TextBox x:Name="ExcludedRolesTextBox" HorizontalAlignment="Right" Height="121" Margin="0,295,412,0" Text="((No Roles Excluded))" VerticalAlignment="Top" Width="210"/>
        <Label x:Name="ExcludeLabel" Content="Exclude Roles" HorizontalAlignment="Right" Margin="0,231,542,0" VerticalAlignment="Top" RenderTransformOrigin="-0.158,0.226"/>
        <ComboBox x:Name="ERoles" HorizontalAlignment="Right" Margin="0,260,466,0" VerticalAlignment="Top" Width="130"/>
        <Button x:Name="AddExcludeButton" Content="&gt;&gt;" HorizontalAlignment="Right" Margin="0,262,423,0" VerticalAlignment="Top" Width="23" RenderTransformOrigin="1.591,3.215" ToolTip="Add to Exclude List" Click="AddExcludeButton_Click"/>
        <Label x:Name="IncludedLabel" Content="Server must have one of these roles" HorizontalAlignment="Right" Margin="0,71,423,0" VerticalAlignment="Top"/>
        <Button x:Name="RemoveIncludeButton" Content="&lt;&lt;" HorizontalAlignment="Right" Margin="0,43,586,0" VerticalAlignment="Top" Width="23" Click="RemIncludeButton_Click" ToolTip="Remove from Required List" RenderTransformOrigin="-6.826,0.8"/>
        <Button x:Name="RemoveExcludeButton" Content="&lt;&lt;" HorizontalAlignment="Right" Margin="0,262,601,0" VerticalAlignment="Top" Width="23" Click="RemExcludeButton_Click" ToolTip="Remove from Exclude List" RenderTransformOrigin="-6.826,0.8"/>
        <Button x:Name="ExportServerListButton" Content="Export" HorizontalAlignment="Right" Margin="0,0,649,10" VerticalAlignment="Bottom" Width="75" ToolTip="Export the contents of Serverlist to file" Click="ExportServerListButton_Click"/>
        <!--TreeView x:Name="CascadingCheckboxTreeview" Margin="10,216,559,23" ItemContainerStyle="{StaticResource TreeViewItemStyle}" ItemTemplate="{StaticResource CheckBoxItemTemplate}" /-->
        <TreeView x:Name="CascadingCheckboxTreeview" Margin="10,10,649,48" ItemContainerStyle="{StaticResource TreeViewItemStyle}" ItemTemplate="{StaticResource CheckBoxItemTemplate}"  />
        <Button x:Name="GenerateFiltered" Content="Generate Filtered List" HorizontalAlignment="Right" Margin="0,456,447,0" VerticalAlignment="Top" Width="147" Click="GenerateFiltered_Click"/>

    </Grid>





</Window>

